﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace Molic.Core.ActionHandlers
{
    /// <summary>
    /// The interface implemented by all the action handlers.
    /// The action handlers are responsible for executing the appropriate 
    /// action of a routed command in the Molic Modeler.
    /// </summary>
    public interface IMolicActionHandler
    {
        ICommand Command { get; }

        /// <summary>
        /// Called when the WPF framework needs to know whether the command can be executed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.Input.CanExecuteRoutedEventArgs"/> instance containing the event data.</param>
        void OnQueryEnabled(object sender, CanExecuteRoutedEventArgs e);

        /// <summary>
        /// The WPF framework calls this entry point for the handler to execute the command action.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void OnExecute(object sender, ExecutedRoutedEventArgs e);
    }
}
